import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import PhoneRoot from '../views/PhoneRoot.vue'
import phone from "@/views/phone";
import Translate from "@/views/Translate";
import WordsCan from "@/views/WordsCan";
import Tools from "@/views/Tools";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import(/* webpackChunkName: "about" */ '../views/Main.vue')
  },
  {
    path: '/phone',
    name: 'Phone',
    component: PhoneRoot,
    children:[
      {
        path: 'memorize',
        component: phone
      },
      {
        path: '/',
        component: phone
      },
      {
        path: 'translate',
        component: Translate
      },
      {
        path: 'wordscan',
        component: WordsCan
      },
      {
        path: 'tools',
        component: Tools
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
